<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var twoSum = function(nums, target) {
        var num=0;
        var m=0,n=0;
        for(;m<nums.length-1;m++){
            for(n=m+1;n<nums.length;n++){
                if(nums[m]+nums[n]==target){
                    return [m,n] ;
                }
            }
        }
        };
        a=[2,7,11,15];
        twoSum(a,9);
    </script>
</body>
</html>